package com.zj.dao;

import com.zj.pojo.Student;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface StudentDao {
    List<Student> selectAll();

    @Select("select * from student where studentid = #{id}")
    Student selectById(int id);

    //多条件查询
    //方式一
    //List<Student> selectByCondition(@Param("realname") String realname, @Param("depart") String depart);
    //方式二
    //List<Student> selectByCondition(Student student);
    //方式三
    List<Student> selectByCondition(Map map);

    //单条件动态查询
    List<Student> selectByConditionSingle(Student student);

    /*添加*/
    void add(Student student);

    int update(Student student);

    void deleteById(int id);

    /*批量删除*/
    void deleteByIds(@Param("ids") int[] ids);



}
